Skip to content

Platform: use a pfn to write and reference Darwin.write#26

Merged
compnerd merged 1 commit intomainfrom
compnerd/write
Dec 31, 2025
Merged

Platform: use a pfn to write and reference Darwin.write#26
compnerd merged 1 commit intomainfrom
compnerd/write

Conversation

@compnerd
Copy link
Owner

The write method is not properly exposed through the unistd module on Darwin. As a result, we need to special case macOS and pull it from the Darwin module.

The `write` method is not properly exposed through the `unistd` module
on Darwin. As a result, we need to special case macOS and pull it from
the `Darwin` module.
@compnerd compnerd requested a review from Copilot December 31, 2025 00:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a platform-specific issue where the write function is not properly exposed through the unistd module on Darwin/macOS. The solution refactors the code to use a function pointer (pfnWrite) that references the appropriate write implementation for each platform (Glibc for GNU, Darwin for macOS, and unistd for other platforms), then calls it uniformly.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@compnerd compnerd merged commit d4c1635 into main Dec 31, 2025
3 checks passed
@compnerd compnerd deleted the compnerd/write branch December 31, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants